﻿


		  <!--
	  <script type="text/javascript" src="<?php echo base_url();?>lib/uedit/ueditor.config.js"></script>
		<script type="text/javascript" src="<?php echo base_url();?>lib/uedit/ueditor.all.js"></script> 
		-->

</head>

<body>

<div id="border">
<div id="border2">

	<div id="header"> 
	<h1>CodeIgniter ACI Read</h1>
	</div>
	<div id="menu">
		<h2>
		<a href=http://localhost/ci3/index.php/account/index> Index </a>  | <a href=http://localhost/ci3/index.php/account/insert> Insert </a>
		</h2>
	</div>


	<div class="MainContent">
	
		<!--	添加 百度uedit
  	<textarea rows="0" cols="0"  style="resize:none;" id="ed1" type="" name="type"> </textarea>   
-->
	<?php
	echo form_open("http://localhost/ci3/".index_page()."/account/update/".$this->uri->segment(3));
echo "<li>username".form_input("username", set_value("username")).form_error("username")."</li>";
echo "<li>password".form_input("password", set_value("password")).form_error("password")."</li>";
echo "<li>email".form_input("email", set_value("email")).form_error("email")."</li>";

	?>

		<div class="row">
            <label for="mod-captcha-code">验证码</label>
            <input name="code" id="mod-captcha-code" size="6" class="zjcaptcha" style="width:80px" type="text"/> 
            <img class="code-img" style="height:30px;width:80px;" src="http://localhost/ci3/lib/code.php?t=0" onclick="this.src=this.src.substring(0,this.src.indexOf('?')+1)+Math.random();return false;" />
   
            <label class="yzmtips" style="color:red"> </label> 
        </div>
   
            <input type="submit" value="提交" class="submitBtn"/>
      


	</div>

</div>
</div>



  	<!--	添加 百度uedit
  	
  <script type="text/javascript">
 
var ue = UE.getEditor('ed1',{
autoHeight: false,initialFrameHeight:400,initialFrameWidth:800, 
autoHeightEnabled: true,
autoFloatEnabled: true
});
</script>
 
-->

<script>
(function($){
    $(document).ready(function(){
        $(".submitBtn").click(function() {
            var obj = $(this);
            $.ajax({
                url:'http://localhost/ci3/lib/codep2.php',
                type:'POST',
                data:{code:$.trim($("input[name=code]").val())},
                dataType:'json',
                async:false,
                success:function(result) {
                    if(result.status == 1) {
                        obj.parents('form').submit(); //验证码正确提交表单
                    }else{
                        $(".code-img").click();
                        $(".yzmtips").html('验证码错误！');
                        setTimeout(function(){
                            $(".yzmtips").empty();
                        },3000);
                    }
                },
                error:function(msg){
                    $(".yzmtips").html('Error:'+msg.toSource());
                }
            })
            return false;
        })
    });
})(jQuery);
</script>

